#ifndef CONTROLLER_H_
#define CONTROLLER_H_


#include <CvUtils/Thread.h>

#include <cv.h>

#include <deque>

#include "ErrorCodes.hpp"

#include "Features.h"

/* forward declarations to allow mutual includes */
class Gui;
class Input;
class PTOParser;


class Controller : public Thread
{
public:
	Controller();
	virtual ~Controller();
	
	
public:
	errorCodes::errorCode init(bool useFile, std::string videoFileName);
	void shutDown();
	/* void start(void* arg) is inherited from Thread */
	
	errorCodes::errorCode loadImage(std::string filename, IplImage* &image);
	
	CvMat* findHomography(std::deque<Features::FeaturePair> seqMatches);
	
protected: /* inherited methods */
	virtual void setup();
	virtual void execute(void* arg);
	
private:
	
	bool finished;
	
	Gui* gui;
	Input* input;
	PTOParser* parser;
	
	
	
};

#endif /*CONTROLLER_H_*/
